package cn.itsource.org.domain;

import cn.itsource.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Department extends BaseDomain {

    private String sn;
    private String name;
    private String dirPath;
    private Integer state;
    private Long managerId;
    private Long parentId;

    private String managerName; //部门管理员
    private String parentName; //上级部门

    //用于封装当前部门的子部门
    //部门树最后一级没有数据就不显示
    //坑：children这个单词不能乱写，必须与elementUI的上传组件中保持一致，不然前端没有数据
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();
}
